This lets you define a section. You give first the default values, which are used by all instruments in this section. Next comes the instruments and their classes, which differ from the default values.
(def-section sect-a
default
zone '(1/1 1/1)
tonality (activate-tonality (major c 4))
length '(1/16)
velocity '(64)
piano
symbol '(a b c)
synth-group
symbol '(-b -c -d)
)
Combining def-section with clone-section allows a natural-like composing method, where you start with an idea, and then let it evolute toward final target. When you want to play sections to a MIDI file, this is done most easily with play-file.
The instrument can be a single instrument, or instrument group defined with def-orchestra. The properties are inherited to all sub-groups and instruments of the group.
Def-section has default slot and instrument slots. tempo-zone can be only in
the default slot, there cannot be individual midi tempos for each instrument
To have a section that lasts 16 bars, has tempo value for each bar, is
written this way. Default gives value for all instruments that have no
definition in this slot, here zone and tonality are used for all instruments.
(def-section study
default
zone (gen-repeat 16 '(1/1))
tonality (activate-tonality (major c 4))
tempo-zones (gen-repeat 16 '(1/1))
tempo (vector-to-list
(vector-scale 40 80
(vector-resynthesize 2
(gen-noise-white 16 1 0.123) nil t)))
piano
channel 1
symbol '(a b c)
length '(1/16 1/8)
duration '(1/4 1/2)
velocity '(64)
tuning '(-10 10 0)
program 16
controller
(gm-controllers ;<-- use your synth controller setup
main-volume (list (vector-round 50 90
(gen-sin 1 0.3 32))))
)
;When you use nil file name then output goes to "song midi" file in